'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller, middleware } = app;
  router.get('/', controller.home.index);

  // 登录接口
  router.post('/api/login', controller.login.login);

  // 获取用户信息
  router.get('/api/getUserInfo', controller.login.userInfo);

  //  获取用户列表的接口
  router.get('/api/getUserList', middleware.error(), middleware.auth(), controller.user.userList);

  // 修改用户权限
  router.post('/api/editRule', middleware.error(), middleware.auth(), controller.user.editRule);

};
